<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CMS_get1_ReceiptRequest</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="#NOTES">NOTES</a></li>
  <li><a href="#RETURN-VALUES">RETURN VALUES</a></li>
  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="#COPYRIGHT">COPYRIGHT</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, CMS_ReceiptRequest_get0_values - CMS signed receipt request functions</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code> <span class="comment">#include &lt;openssl/cms.h&gt;</span>
 
 <span class="variable">CMS_ReceiptRequest</span> <span class="variable">*CMS_ReceiptRequest_create0</span><span class="operator">(</span><span class="variable">unsigned</span> <span class="variable">char</span> <span class="variable">*id</span><span class="operator">,</span> <span class="keyword">int</span> <span class="variable">idlen</span><span class="operator">,</span>
                                                <span class="keyword">int</span> <span class="variable">allorfirst</span><span class="operator">,</span>
                                                <span class="variable">STACK_OF</span><span class="operator">(</span><span class="variable">GENERAL_NAMES</span><span class="operator">)</span> <span class="variable">*receiptList</span><span class="operator">,</span>
                                                <span class="variable">STACK_OF</span><span class="operator">(</span><span class="variable">GENERAL_NAMES</span><span class="operator">)</span> <span class="variable">*receiptsTo</span><span class="operator">);</span>
 <span class="keyword">int</span> <span class="variable">CMS_add1_ReceiptRequest</span><span class="operator">(</span><span class="variable">CMS_SignerInfo</span> <span class="variable">*si</span><span class="operator">,</span> <span class="variable">CMS_ReceiptRequest</span> <span class="variable">*rr</span><span class="operator">);</span>
 <span class="keyword">int</span> <span class="variable">CMS_get1_ReceiptRequest</span><span class="operator">(</span><span class="variable">CMS_SignerInfo</span> <span class="variable">*si</span><span class="operator">,</span> <span class="variable">CMS_ReceiptRequest</span> <span class="operator">**</span><span class="variable">prr</span><span class="operator">);</span>
 <span class="variable">void</span> <span class="variable">CMS_ReceiptRequest_get0_values</span><span class="operator">(</span><span class="variable">CMS_ReceiptRequest</span> <span class="variable">*rr</span><span class="operator">,</span> <span class="variable">ASN1_STRING</span> <span class="operator">**</span><span class="variable">pcid</span><span class="operator">,</span>
                                     <span class="keyword">int</span> <span class="variable">*pallorfirst</span><span class="operator">,</span>
                                     <span class="variable">STACK_OF</span><span class="operator">(</span><span class="variable">GENERAL_NAMES</span><span class="operator">)</span> <span class="operator">**</span><span class="variable">plist</span><span class="operator">,</span>
                                     <span class="variable">STACK_OF</span><span class="operator">(</span><span class="variable">GENERAL_NAMES</span><span class="operator">)</span> <span class="operator">**</span><span class="variable">prto</span><span class="operator">);</span>
</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>CMS_ReceiptRequest_create0() creates a signed receipt request structure. The <b>signedContentIdentifier</b> field is set using <b>id</b> and <b>idlen</b>, or it is set to 32 bytes of pseudo random data if <b>id</b> is NULL. If <b>receiptList</b> is NULL the allOrFirstTier option in <b>receiptsFrom</b> is used and set to the value of the <b>allorfirst</b> parameter. If <b>receiptList</b> is not NULL the <b>receiptList</b> option in <b>receiptsFrom</b> is used. The <b>receiptsTo</b> parameter specifies the <b>receiptsTo</b> field value.</p>

<p>The CMS_add1_ReceiptRequest() function adds a signed receipt request <b>rr</b> to SignerInfo structure <b>si</b>.</p>

<p>int CMS_get1_ReceiptRequest() looks for a signed receipt request in <b>si</b>, if any is found it is decoded and written to <b>prr</b>.</p>

<p>CMS_ReceiptRequest_get0_values() retrieves the values of a receipt request. The signedContentIdentifier is copied to <b>pcid</b>. If the <b>allOrFirstTier</b> option of <b>receiptsFrom</b> is used its value is copied to <b>pallorfirst</b> otherwise the <b>receiptList</b> field is copied to <b>plist</b>. The <b>receiptsTo</b> parameter is copied to <b>prto</b>.</p>

<h1 id="NOTES">NOTES</h1>

<p>For more details of the meaning of the fields see RFC2634.</p>

<p>The contents of a signed receipt should only be considered meaningful if the corresponding CMS_ContentInfo structure can be successfully verified using CMS_verify().</p>

<h1 id="RETURN-VALUES">RETURN VALUES</h1>

<p>CMS_ReceiptRequest_create0() returns a signed receipt request structure or NULL if an error occurred.</p>

<p>CMS_add1_ReceiptRequest() returns 1 for success or 0 if an error occurred.</p>

<p>CMS_get1_ReceiptRequest() returns 1 is a signed receipt request is found and decoded. It returns 0 if a signed receipt request is not present and -1 if it is present but malformed.</p>

<h1 id="SEE-ALSO">SEE ALSO</h1>

<p><a href="../man3/ERR_get_error.html">ERR_get_error(3)</a>, <a href="../man3/CMS_sign.html">CMS_sign(3)</a>, <a href="../man3/CMS_sign_receipt.html">CMS_sign_receipt(3)</a>, <a href="../man3/CMS_verify.html">CMS_verify(3)</a> <a href="../man3/CMS_verify_receipt.html">CMS_verify_receipt(3)</a></p>

<h1 id="COPYRIGHT">COPYRIGHT</h1>

<p>Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.</p>

<p>Licensed under the OpenSSL license (the &quot;License&quot;). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>


</body>

</html>


